//! Redis-rs2: A Redis server implementation written in Rust
//! 
//! This crate provides a high-performance, memory-safe Redis server implementation
//! using Rust's async/await features and Tokio runtime.

pub mod core;      // 业务无关的公共库
pub mod storage;   // 存储层，依赖 core 模块
pub mod error;     // 错误处理
pub mod event;     // 事件驱动，依赖 core 模块
pub mod protocol;  // RESP协议解析层
pub mod network;   // 网络层，实现具体的网络通信
pub mod cluster;   // 集群功能模块
pub mod server;    // 服务器模式模块
pub mod config;    // 配置管理模块

// Re-export commonly used types
pub use storage::{DataType};  // Storage已删除
pub use error::{Result, StorageError};
pub use event::{Event, EventPayload, EventDispatcher, DispatcherConfig};
pub use protocol::{RespParser, CommandProcessor, ConnectionManager, NetworkStream};

// Re-export cluster types
pub use cluster::{
    ClusterConfig, ClusterNode, ClusterCoordinator, 
    SlotManager, ClusterNetworkManager, GossipProtocol,
    ClusterState, ClusterCommandProcessor, RedisClusterCommand, 
    ClusterError, ClusterResult
};

// Re-export server types
pub use server::{ServerMode, StandaloneServer, ClusterServer};

// Re-export config types
pub use config::{ConfigLoader, ConfigFormat, UnifiedConfigLoader, load_config};

// Re-export core utilities for external use
pub use core::*;

/// Version information
pub const VERSION: &str = env!("CARGO_PKG_VERSION");